package com.bookmanger.common.utils;

import com.bookmanger.entity.dto.LoginDTO;
import com.bookmanger.entity.dto.ManagerDTO;

/**
 * @author huangfuhao
 * @Date 2024/11/17
 */
public class LoginHolder {

        private static final ThreadLocal<LoginDTO> tl = new ThreadLocal<>();

        public static void saveUser(LoginDTO user){
            tl.set(user);
        }

        public static LoginDTO getUser(){
            return tl.get();
        }

        public static void removeUser(){
            tl.remove();
        }

}
